Skip to content

Fixes for yeoman generator - #56

Merged
bajtos merged 9 commits into
3.0from
fixes-for-yeoman
Jun 30, 2014
Merged

Fixes for yeoman generator#56
bajtos merged 9 commits into
3.0from
fixes-for-yeoman

Conversation

@bajtos

@bajtos bajtos commented Jun 30, 2014

Copy link
Copy Markdown
Member

This patch contains changes required by yo loopback and fixes for bugs discovered along the way.

  • package: add mocha as dev-dep and test script
  • ModelDefinition: include name in the json file
  • Workspace: implement listAvailableConnectors
  • ModelProperty: implement availableTypes
  • ModelAccessControl: improve metadata providers
  • Fix serialization of Model ACLs.
  • connector: fix race condition in loadFromFile
  • ModelAccessControl: rename 'method' to 'property'
  • Fix deserialization of embedded key-value maps

/to @ritch please review

Miroslav Bajtoš added 9 commits June 30, 2014 10:10
Fix `ModelDefinition.getConfigData` to include model name in the
generated data.
The list is maintained in the file `available-connectors.json` for now.
A list of types to offer when creating a new property.
Rename the property `humanized` to `name`.

Add `ModelAccessControl.getBuiltinRoles`.

Add the `cb` argument where missing.
Add a new `embedded` property `name` that overrides the serialized
property name (`acls` instead of `accessControls`).

Fix deserialization of embedded arrays:
 - use `id` from the data as an id property - this has to be fixed
   later.
 - fill `relatedModel[foreignKey]` with the model name to preserve
   entity relation
Move calls of `loader.emit` to the very last callback, to make sure
the events are raised only once and only after all work has already
been done.
Fix ModelAccessControl model to match the ACL definition expected by
loopback.
Fill `relatedModel[foreignKey]` with the model name to preserve
entity relation.
Comment thread models.json

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to change this in 2.0. "Access Control Lists" is misleading / incorrect.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I quite like permissions, it was used by 2.0 workspace API.

Unless you have time to implement that change today, I am proposing to merge this PR and make the change later.

BTW to make the migration easy, LB 2.0 should support both old (acls) and the new property when reading config files. workspace should probably support the old name too at read-time

@ritch

ritch commented Jun 30, 2014

Copy link
Copy Markdown
Member

LGTM

bajtos added a commit that referenced this pull request Jun 30, 2014
@bajtos
bajtos merged commit e23fc54 into 3.0 Jun 30, 2014
@bajtos
bajtos deleted the fixes-for-yeoman branch June 30, 2014 15:58
This was referenced Jul 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants